new Vue({
	el: ".newsvue",
	data() {
		return {
			ip: IPCMS,
			url: "/index.php/api/Pages",
			pageid: "",
			newsdata: {},
		}
	},
	methods: {
		getequest() {
			var url = location.search; //获取url中"?"符后的字串   
			var theRequest = new Object();
			if(url.indexOf("?") != -1) {
				var str = url.substr(1);
				strs = str.split("&");
				for(var i = 0; i < strs.length; i++) {
					theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
				}
			}
			return theRequest;
		},
		getData() {
			var u = this.getequest();
			var http = this.ip + this.url + "/" + u.id;
			console.log(http);
			this.$http.jsonp(http).then(res => {
				var body = res.body;
				this.newsdata = body;
				console.log("===" + JSON.stringify(body));
			}).catch(res => {
				console.log("请求出错");
			})
		},
		timestampToTime(timestamp) {
			return pub.timestampToTime(timestamp);
		}

	},
	created() {
		this.getData();
	},
});
new Vue({
	el:".go",
	methods:{
		/**
		 * 返回上一页
		 */
		histroygo(){
			history.go(-1);
		},
	}
})